package com.evil.application.api;

import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.order.OrderMyNodesReqDTO;
import com.evil.application.pojo.dto.order.node.AddOrderNodeBaseReqDTO;
import com.evil.application.pojo.dto.order.node.HandleOrderNodeReqDTO;
import com.evil.application.pojo.dto.order.node.ModifyOrderNodeDataReqDTO;
import com.evil.common.account.dto.user.UserEnterpriseDTO;
import com.evil.common.application.dto.order.node.ChangeOrderNodeDataReqDTO;
import com.evil.common.application.dto.order.node.OrderNodeReqDTO;
import com.evil.common.application.dto.process.node.NodeBaseDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用订单节点接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationOrderNodeService {

    /**
     * 订单我的节点列表
     *
     * @param orderMyNodesReqDTO orderMyNodesReqDTO
     * @return List
     */
    @PostMapping("/remote/application/order/my-nodes")
    List<NodeBaseDTO> orderMyNodes(@Validated @RequestBody OrderMyNodesReqDTO orderMyNodesReqDTO);

    /**
     * 新增订单节点
     *
     * @param addOrderNodeBaseReqDTO orderNodeBaseReqDTO
     */
    @PostMapping("/remote/application/order/node/add")
    void addOrderNode(@Validated @RequestBody AddOrderNodeBaseReqDTO addOrderNodeBaseReqDTO);

    /**
     * 订单节点流转
     *
     * @param handleOrderNodeReqDTO completeOrderNodeReqDTO
     */
    @PostMapping("/remote/application/order/node/handle")
    void handleOrderNode(@Validated @RequestBody HandleOrderNodeReqDTO handleOrderNodeReqDTO);

    /**
     * 订单节点拒绝
     *
     * @param handleOrderNodeReqDTO completeOrderNodeReqDTO
     */
    @PostMapping("/remote/application/order/node/refuse")
    void refuseOrderNode(@Validated @RequestBody HandleOrderNodeReqDTO handleOrderNodeReqDTO);

    /**
     * 订单更新 当前节点控件 数据
     *
     * @param modifyOrderNodeDataReqDTO modifyOrderNodeDataReqDTO
     */
    @PostMapping("/remote/application/order/node/data/modify")
    void modifyOrderNodeData(@Validated @RequestBody ModifyOrderNodeDataReqDTO modifyOrderNodeDataReqDTO);

    /**
     * 订单删除 当前节点控件 数据
     *
     * @param changeOrderNodeDataReqDTO changeOrderNodeDataReqDTO
     */
    @PostMapping("/remote/application/order/node/data/change")
    void changeOrderNodeData(@Validated @RequestBody ChangeOrderNodeDataReqDTO changeOrderNodeDataReqDTO);
}
